package com.csoa.community.requests;

import java.util.List;

import org.apache.http.message.BasicNameValuePair;
import org.json.JSONException;

import com.csoa.community.bean.UserBean;
import com.csoa.community.net.ErrorMsg;
import com.csoa.community.utils.Json;
import com.csoa.community.utils.StringUtils;

public class LoginRequest extends AbstractRequest {

	public UserBean user;
	public LoginRequest(List<BasicNameValuePair> requestValues) {
		super(LOGIN_METHOD, requestValues);
	}

	

	@Override
	protected void parseRemaingInfo(String json) throws ErrorMsg, JSONException {
		if(!StringUtils.isEmpty(json)) {
			user = new UserBean();
			String stadard = json.replace("[", "").replace("]", "");
			Json jsonUser = new Json(stadard);
			user.loginName = jsonUser.getString("LoginName");
			user.userName = jsonUser.getString("UserName");
		}
		
	}
}
